@csrf
@if($is_china)
<div class="layui-row">
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label for="name" class="layui-form-label">学校名称</label>
            <div class="layui-input-block">
                <input type="hidden" name="country_id" value="{{$china->procity_id}}">
                <input type="text" name="name" class="layui-input" value="{{$college->name??''}}" placeholder="请填写学校名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="province" class="layui-form-label">所属省份</label>
            <div class="layui-input-block">
                <input type="text" name="province" class="layui-input" value="{{$college->province??''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="level" class="layui-form-label">办学层次</label>
            <div class="layui-input-block">
                <select name="level" placeholder="办学层次">
                    <option value="专科" @if($college->level == '专科')selected @endif>专科</option>
                    <option value="本科" @if($college->level == '本科')selected @endif>本科</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="grade" class="layui-form-label">等级</label>
            <div class="layui-input-block">
                <select name="grade" placeholder="等级">
                    @foreach ($grades as $grade)
                    <option value="{{$grade['id']}}" @if($college->grade == $grade['id'])selected
                        @endif>{{$grade['title']}}</option>
                    @endforeach
                </select>
            </div>
        </div>

    </div>
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label for="code" class="layui-form-label">学校标识码</label>
            <div class="layui-input-block">
                <input type="text" name="code" class="layui-input" value="{{$college->code??''}}"
                    placeholder="请填写学校标识码">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="city" class="layui-form-label">所在地</label>
            <div class="layui-input-block">
                <input type="text" name="city" class="layui-input" value="{{$college->city??''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="category" class="layui-form-label">类别</label>
            <div class="layui-input-block">
                <input type="text" name="category" class="layui-input" value="{{$college->category??''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="competent_department" class="layui-form-label">主管部门</label>
            <div class="layui-input-block">
                <input type="text" name="competent_department" class="layui-input"
                    value="{{$college->competent_department??''}}" placeholder="请填写主管部门">
            </div>
        </div>
    </div>
</div>
<div class="layui-row">
    <div class="layui-form-item">
        <label for="tags" class="layui-form-label">标签</label>
        <div class="layui-input-block">
            <ul id="tagTree" data-id="" class="dtree"></ul>
            <input type="hidden" name="tags" id="tags" value="{{$college->tags??''}}">
        </div>
    </div>
</div>
@else
<div class="layui-row">
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label for="name" class="layui-form-label">学校名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" class="layui-input" value="{{$college->name??''}}" placeholder="请填写学校名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="country_id" class="layui-form-label">国家</label>
            <div class="layui-input-block">
                <select id='country_id' name="country_id" placeholder="国家" lay-filter="country">
                    @foreach ($countries as $country)
                    @if($country->name!='中国')
                    <option value="{{$country->procity_id}}" @if($college->country_id == $country->procity_id)selected
                        @endif>{{$country->name}}</option>
                    @endif
                    @endforeach
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="level" class="layui-form-label">办学层次</label>
            <div class="layui-input-block">
                <select name="level" placeholder="办学层次">
                    <option value="专科" @if($college->level == '专科')selected @endif>专科</option>
                    <option value="本科" @if($college->level == '本科')selected @endif>本科</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="grade" class="layui-form-label">等级</label>
            <div class="layui-input-block">
                <select name="grade" placeholder="等级">
                    @foreach ($grades as $grade)
                    <option value="{{$grade['id']}}" @if($college->grade == $grade['id'])selected
                        @endif>{{$grade['title']}}</option>
                    @endforeach
                </select>
            </div>
        </div>
    </div>
    <div class="layui-col-md6">
        <div class="layui-form-item">
            <label for="encode" class="layui-form-label">英文名称</label>
            <div class="layui-input-block">
                <input type="text" name="encode" class="layui-input" value="{{$college->encode??''}}"
                    placeholder="请填写英文名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="city" class="layui-form-label">所在城市</label>
            <div class="layui-input-block">
                <input type="text" name="city" class="layui-input" value="{{$college->city??''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="category" class="layui-form-label">类别</label>
            <div class="layui-input-block">
                <input type="text" name="category" class="layui-input" value="{{$college->category??''}}">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="tags" class="layui-form-label">标签</label>
            <div class="layui-input-block">
                <ul id="tagTree" data-id="" class="dtree"></ul>
                <input type="hidden" name="tags" id="tags" value="{{$college->tags??''}}">
            </div>
        </div>
    </div>
</div>
@endif

<div class="layui-row">
    <div class="layui-form-item">
        <label for="description" class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_china" value="{{$is_china}}" />
            <input type="text" name="description" class="layui-input" value="{{$college->description??''}}"
                placeholder="备注">
        </div>
    </div>
</div>
